@svizzle/utils/any-[any-boolean]

Methods

(static) isEqualTo(any) → {function}

Source:
Since:
  • v0.8.0
See:

Return a function that returns true if the input value is equal to the provided value. This can be used to compare objects and arrays, but if the input value is of native type .is or .isSVZ should be used.

Example
> isEqualToObj = isEqualTo({a: 1, b: [1,2]})
> isEqualToObj({a: 1, b: [1, 2]})
true
> isEqualToObj({a: 1, b: [1, 2, 3})
false
> isEqualToArray = isEqualTo([1, 2, {a: 1}])
> isEqualToArray([1, 2, {a: 1}])
true
> isEqualToArray([1, 2, {a: 1}, 3])
false
Parameters:
Name Type Description
any *
Returns:

predicate - Any -> Boolean

Type
function

(static) isNot(any) → {function}

Source:
Since:
  • v0.3.0

Return a function that returns true if the input is different from the provided value.

Example
> isNotTwo = isNot(2)
> isNotTwo(3)
true
> isNotTwo(2)
false
Parameters:
Name Type Description
any *
Returns:

predicate - Any -> Boolean

Type
function